namespace CL_SELF_ASSIGN {
	namespace bad {
		class Pencil {
		};
		class Box {
		public:
			Box& operator=(const Box& rhs) {
				count = rhs.count;
				delete x;
				x = new Pencil(*rhs.x);
			}
		private:
			int count;
			Pencil* x;
		};
	}


	namespace good {
		class Pencil {
		};
		class Box {
		public:
			Box& operator=(const Box& rhs) {
				if (this == &rhs) return *this;
				count = rhs.count;
				delete x;
				x = new Pencil(*rhs.x);
			}
		private:
			int count;
			Pencil* x;
		};
	}
}